package com.wzdigit.wms.basic.mapper.core.inventory;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wzdigit.framework.orm.mybatis.MyBatisRepository;
import com.wzdigit.wms.basic.client.request.report.SaleInvReportSearchRequest;
import com.wzdigit.wms.basic.client.response.report.SaleInvReportReponse;
import com.wzdigit.wms.basic.client.response.report.SaleReportInvInfo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 整机外销库存报表Mapper
 * Created by zyf on 2021/4/22 9:06
 */
@MyBatisRepository
public interface SaleInvReportMapper extends BaseMapper<SaleInvReportReponse>{
    //查询整机报表部分字段
    List<SaleInvReportReponse> selectAll(SaleInvReportSearchRequest dto);

    //查询批次号
    List<String> selectLotno(@Param("so") String so, @Param("soItem")  String soItem);

    //查询库存数量(为null)/封位库存数量(不为null)
    BigDecimal selectInvQty(@Param("dto")SaleInvReportReponse dto,@Param("lotnos") List<String> lotnos,
                            @Param("flag") Integer flag);

    //分组查询库存信息
    List<SaleReportInvInfo> selectSaleInvGroup();

    //分组查询封位库存信息
    List<SaleReportInvInfo> selectFreezeGroup();

    //查询整机外销库存报表【新】
    List<SaleInvReportReponse> selectAllNew(SaleInvReportSearchRequest dto);
}
